From 608c25453b0e95a7fcc0ce9e81b3aa73e9bb39d6 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Thu, 6 Nov 2014 16:17:33 -0500 Subject: [PATCH] x11: round the scaled size *up* when we get a ConfigureNotify Although we specify a resize increment to try and get a size that is a multiple of the window scale, maximization typically wins over the resize increment, so the window might be odd sized. Round *up* in this case, rather than down, since it's better to truncate a line or two at the bottom and right of the window rather than have a line or two that we don't know what to do with. https://bugzilla.gnome.org/show_bug.cgi?id=739750 --- gdk/x11/gdkdisplay-x11.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 2ebbed9953..d5cf7d666f 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -767,8 +767,8 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, : "")); if (window && GDK_WINDOW_TYPE (window) == GDK_WINDOW_ROOT) { - window->width = xevent->xconfigure.width / window_impl->window_scale; - window->height = xevent->xconfigure.height / window_impl->window_scale; + window->width = (xevent->xconfigure.width + window_impl->window_scale - 1) / window_impl->window_scale; + window->height = (xevent->xconfigure.height + window_impl->window_scale - 1) / window_impl->window_scale; _gdk_window_update_size (window); _gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl)); @@ -793,8 +793,8 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, { event->configure.type = GDK_CONFIGURE; event->configure.window = window; - event->configure.width = xevent->xconfigure.width / window_impl->window_scale; - event->configure.height = xevent->xconfigure.height / window_impl->window_scale; + event->configure.width = (xevent->xconfigure.width + window_impl->window_scale - 1) / window_impl->window_scale; + event->configure.height = (xevent->xconfigure.height + window_impl->window_scale - 1) / window_impl->window_scale; if (!xevent->xconfigure.send_event && !xevent->xconfigure.override_redirect && @@ -826,8 +826,8 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator, { window->x = event->configure.x; window->y = event->configure.y; - window->width = xevent->xconfigure.width / window_impl->window_scale; - window->height = xevent->xconfigure.height / window_impl->window_scale; + window->width = event->configure.width; + window->height = event->configure.height; _gdk_window_update_size (window); _gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl)); -- 2.30.2